#ifndef _DSWCONSOLE_GPRS_AXSESSION_H
#define _DSWCONSOLE_GPRS_AXSESSION_H
#include "libdswservercenter/dswserversession.h"
#include "libdswservercenter/3Des.h"
#include "dswconsole_gprs_session_base.h"

class CDswconsole_gprs_axsession : public CDswconsole_gprs_session_base
{
public:
	CDswconsole_gprs_axsession(LPST_ENV_T pEnv, EN_MISSION_TYPE nType, CB_ON_MISSION_NOTIFY pFunc, void* pParent, struct bufferevent *pBev);
	virtual ~CDswconsole_gprs_axsession();
public:
	virtual void ProcessData(char* pData, int nLen);
	bool IsCommOk(){return m_bCommOk;};
private:
	virtual void OnCommTimeOut();
private:
	void EnDecData(unsigned char *pData,  unsigned int nLen);
	void SendAuthReq(unsigned char *pData, int nLen);
	void SendGetSvrListReq(LPST_SERVERCOM_T pCmd);
	void GetSvrListResp(unsigned char* pdata, int nlen);
	void GetSvrTimeReq(unsigned char* pData, int nLen);
	void SendDeviceTypeToServ(LPST_SERVERCOM_T pCmd);
	void SendLocateNameReq(LPST_SERVERCOM_T pCmd);
	void SendExitReq(LPST_SERVERCOM_T pCmd);
	void SendAreNameReq(LPST_SERVERCOM_T pCmd);
	void SendHeartBeetReq(LPST_SERVERCOM_T pCmd);
	bool SendAlarmInfoReq(LPST_SERVERCOM_T pCmd);
	void SendAlarmReq(LPST_SERVERCOM_T pCmd, LPST_CAPTURE_RESULT_T pResult);
private:
	EN_MISSION_TYPE m_nMissionType;
	CB_ON_MISSION_NOTIFY m_pNotifyFunc;
	void* m_pParent;
	ST_SERVERCOM_T m_nCurCommand;
	unsigned char m_key[16];
	bool m_bCommOk;
	
	int m_nRegisterCount;
};

#endif

